package com.mo.web.pojo;

import lombok.Getter;
import lombok.Setter;


@Getter
@Setter
public class JsonResult {
    /*状态码*/
     private Integer state=1;//0表示Exception
    /*状态信息*/
    private String message="ok";
    /*响应数据，一般为查询操作结果*/
     private Object data;


     //快速生成相关方法

public JsonResult(){}

    public JsonResult(Object data) {
        this.data = data;
    }

    public JsonResult(String message) {
        this.message = message;
    }

    public JsonResult(Throwable e) {//异常信息封装
       // this.state=0;
        //this.message = e.getMessage();
    this(0,e.getMessage());
    }

    public JsonResult(Integer state, String message) {
         this(message);
         this.state=state;
}




}
